#include<iostream>
#include "treeNode.h"
using namespace std;

template<typename T>
TreeNode<T>::TreeNode()
{
	left = right = -1;
}

template<typename T>
TreeNode<T>::TreeNode(const T &t, int left, int right)
{
	this->tNode = t;
	this->left = left;
	this->right = right;
}

template<typename T>
TreeNode<T>::TreeNode(const TreeNode<T> &tNode)
{
	this->tNode = tNode.tNode;
}
template<typename T>
void TreeNode<T>::setLeft(int index)
{
	this->left = index;
}

template<typename T>
void TreeNode<T>::setRight(int index)
{
	this->right = index;
}

template<typename T>
void TreeNode<T>::setNode(const T &tNode)
{
	this->tNode = tNode;
}

template<typename T>
int TreeNode<T>::getLeft()
{
	return this->left;
}

template<typename T>
int TreeNode<T>::getRight()
{
	return this->right;
}

template<typename T>
T TreeNode<T>::getNode()
{
	return tNode;
}

template<typename T>
const TreeNode<T>& TreeNode<T>::operator = (const TreeNode<T> & t)
{
	if(this == &t)
		return *this;

	this->tNode = t.tNode;
	this->left = t.left;
	this->right = t.right;
	return *this;
}

template<typename T>
bool TreeNode<T>::operator > (const TreeNode<T> & t)
{
	return this->tNode > t.tNode;
}

template<typename T>
bool TreeNode<T>::operator == (const TreeNode<T> & t)
{
	return this->tNode == t.tNode;
}

template<typename T>
bool TreeNode<T>::operator < (const TreeNode<T> & t)
{
	return this->tNode < t.tNode;
}
